<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>\</title>
</head>
<script src="js/axios.min.js"></script>
<body>
<div>
<button onclick="doAxiosAjaxGet()">axios.get(...)</button>
<button onclick="doAxiosAjaxPost()">axios.post(...)</button>
</div>
<div class="result"></div>
</body>
<script>
    function doAxiosAjaxPost(){
        let url="http://localhost:1314/doPostJson";
        let params={params:{"msg":"hello axios"}};
        axios.post(url,params)
            .then(function (res){
                console.log(res);
                document.querySelector(".result").innerHTML=JSON.stringify(res.data);
            })
            .catch(function (error){
                console.log(error);
            })
    }
    function doAxiosAjaxGet(){
        let url="http://localhost:1314/doAjax";
        let params={params:{"msg":"hello axios"}};
        axios.get(url,params)
        .then(function (res){
            console.log(res);
            document.querySelector(".result").innerHTML=JSON.stringify(res.data);
        })
        .catch(function (error){
            console.log(error);
        })
    }
</script>
</html>